#include "global.h"
#include "manageindex.h"
#include "ui_manageindex.h"
#include "m_studentmanage.h"
#include "m_exchangemanage.h"
#include "m_housemastermanage.h"
#include "m_buildmanage.h"
#include <QSqlQuery>

manageIndex::manageIndex(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::manageIndex)
{
    ui->setupUi(this);

    //获取姓名
    QString sql=QString("select gname from guanliyuan where gid='%1'").arg(global::userid);
    QSqlQuery query;
    query.exec(sql);
    QString qname;
    while(query.next())
        qname=QString("欢迎你，%1").arg(query.value(0).toString());
    ui->helloText->setText(qname);
}

manageIndex::~manageIndex()
{
    delete ui;
}

void manageIndex::on_stuInfoManage_clicked()
{
    M_studentManage window;
    window.exec();
}

void manageIndex::on_exchangeManage_clicked()
{
    M_exchangeManage window;
    window.exec();
}


void manageIndex::on_houseMasterManage_clicked()
{
    M_houseMasterManage window;
    window.exec();
}


void manageIndex::on_buildManage_clicked()
{
    M_buildManage window;
    window.exec();
}

